From: Stefan Monnier Date: Thu, 25 Nov 2010 21:59:30 +0000 (-0500) Subject: * diff.el (diff): Fix it for good, hopefully, this time. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5531 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=b7d0df28f98e7497a990ccc9141edfad08cc81cd;p=emacs.git * diff.el (diff): Fix it for good, hopefully, this time. --- diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 13c23eea734..5809eee9aef 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -84,14 +84,13 @@ When called interactively with a prefix argument, prompt interactively for diff switches. Otherwise, the switches specified in `diff-switches' are passed to the diff command." (interactive - (let* ((newf (buffer-file-name)) - (oldf (file-newest-backup newf))) - (setq newf (if (and newf (file-exists-p newf)) + (let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name)) (read-file-name (concat "Diff new file (default " - (file-name-nondirectory newf) "): ") - nil newf t) + (file-name-nondirectory buffer-file-name) "): ") + nil buffer-file-name t) (read-file-name "Diff new file: " nil nil t))) + (oldf (file-newest-backup newf))) (setq oldf (if (and oldf (file-exists-p oldf)) (read-file-name (concat "Diff original file (default "